home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Communications
/
General
/
LineShare Folder
/
Put Onto Productions Disks
/
ARA⁄LineShare
/
ARA_LineShare
next >
Wrap
Text File
|
1994-04-22
|
5KB
|
256 lines
! Version 2.5
! ARA 2.0 script for connections through a LineShare subPort.
! All modem-specific commands should be moved to the LineShare script.
! So, this ARA script is universal
!
! We assume that the LineShare script has set the modem to the
! "Direct" mode, if the "CONNECT" message is detected
! (in this case our business is to adjust the serial port speed), or to the
! "Normal" mode, if the "CARRIER" message is detected.
! If LineShare returns the REL message,
! we tell ARA 2.0, that a reliable link is established
! We don't process the "^2" parameter (speaker), since it's controlled with LineShare
!
!
@ORIGINATE
@ANSWER
HSReset 0 0 0 0 0 0
!
! Load Factory configurations (i.e. reset the LineShare emulator),switch off the echo
!
matchclr
matchstr 1 1 "OK\13\10"
write "AT&FE0\13"
matchread 10
jump 79
@LABEL 1
!
! The modem is ready so enable answering, or originate a call
!
ifAnswer 10
!
! 0,1,2 - Normal,Blind,Manual
ifStr 6 7 "0"
ifStr 6 5 "1"
ifStr 6 4 "2"
Jump 8
!
@LABEL 4
Note "Manual dialing initiated..." 3
Write "ATX1D \13"
Jump 15
!
@LABEL 5
note "Dialing without dialtone." 3
MatchClr
MatchStr 1 7 "OK\13\10"
Write "ATX3\13"
MatchRead 30
jump 79
!
! Parameter 1 contains the full dialstring from the connection document.
! Parameter 3 contains "P" for pulse & "t" for tone dialing.
! Parameter 7, 8 & 9 contain the dial string fragments (only parameter 7 is used)
@Label 7
Note "Dialing ^7." 3
Write "ATD^3^7\13"
Jump 15
@Label 8
Note "Dialing ^1." 3
Write "ATDT^1\13"
Jump 15
!
!
! Answering
@LABEL 10
MatchClr
MatchStr 1 15 "OK\13\10"
Write "ATS0=1\13"
MatchRead 30
Jump 79
!
@LABEL 15
MatchClr
MatchStr 1 19 "CARRIER "
Matchstr 2 18 "CONNECT "
matchstr 8 16 "RING\13\10"
matchstr 9 17 "REL\13\10"
matchstr 10 70 "NO CARRIER\13\10"
matchstr 11 70 "ERROR\13\10"
matchstr 12 72 "NO DIALTONE\13\10"
matchstr 13 73 "BUSY\13\10"
matchstr 14 74 "NO ANSWER\13\10"
matchread 800
ifAnswer 10
Jump 79
!
@LABEL 16
ifOriginate 15
userhook 1
note "Answering phone…" 2
Jump 15
!
@LABEL 17
userhook 2
note "Reliable link…" 3
jump 15
!
! Process the "CONNECT" message - assume that we are in the "Direct" mode
@LABEL 18
MatchClr
matchstr 2 22 "2400"
matchstr 3 23 "4800"
matchstr 4 24 "7200"
matchstr 5 25 "9600"
matchstr 6 26 "12000"
matchstr 7 27 "14400"
matchstr 8 28 "16800"
matchstr 9 29 "19200"
matchread 10
jump 79
!
! Process the "CARRIER" message - assume that we are in the "Normal" mode
@LABEL 19
MatchClr
matchstr 2 32 "2400"
matchstr 3 33 "4800"
matchstr 4 34 "7200"
matchstr 5 35 "9600"
matchstr 6 36 "12000"
matchstr 7 37 "14400"
matchstr 8 38 "16800"
matchstr 9 39 "19200"
matchread 10
jump 79
@LABEL 22
note "Communicating at 2400 bps." 2
setspeed 2400
jump 61
!
@LABEL 23
note "Communicating at 4800 bps." 2
setspeed 4800
jump 61
!
@LABEL 24
note "Communicating at 7200 bps." 2
setspeed 7200
jump 61
!
@LABEL 25
note "Communicating at 9600 bps." 2
setspeed 9600
jump 61
!
@LABEL 26
note "Communicating at 12000 bps." 2
setspeed 12000
jump 61
!
@LABEL 27
note "Communicating at 14400 bps." 2
setspeed 14400
jump 61
!
@LABEL 28
note "Communicating at 16800 bps." 2
setspeed 16800
jump 61
!
@LABEL 29
note "Communicating at 19200 bps." 2
setspeed 19200
jump 61
!
! CARRIER XXXX processing
!
@LABEL 32
note "Linked at 2400 bps." 2
CommunicatingAT 2400
jump 60
!
@LABEL 33
Note "Linked at 4800 bps." 2
CommunicatingAT 4800
jump 60
!
@LABEL 34
note "Linked at 7200 bps." 2
CommunicatingAT 7200
jump 60
!
@LABEL 35
note "Linked at 9600 bps." 2
CommunicatingAT 9600
jump 60
!
@LABEL 36
note "Linked at 12000 bps." 2
CommunicatingAT 12000
jump 60
!
@LABEL 37
note "Linked at 14400 bps." 2
CommunicatingAT 14400
jump 60
!
@LABEL 38
note "Linked at 16800 bps." 2
CommunicatingAT 16800
jump 60
!
@LABEL 39
note "Linked at 19200 bps." 2
CommunicatingAT 19200
jump 60
!
@LABEL 60
HSReset 0 1 0 0 0 0
@LABEL 61
ifANSWER 62
pause 30
@LABEL 62
exit 0
!
!
! 70: error messages
! No carrier
@LABEL 70
exit -6021
! No Dial Tone
@LABEL 72
exit -6020
! Busy
@LABEL 73
exit -6022
! No Answer
@LABEL 74
exit -6023
! Invalid Varstring Value
@LABEL 76
exit -6027
! Modem error
@LABEL 79
exit -6019
!
! Hang up the modem
!
@HANGUP
HSReset 0 0 0 0 0 0
settries 0
@LABEL 80
DTRClear
pause 2
DTRSet
write "ATZ\13"
matchclr
matchstr 1 82 "OK\13\10"
matchread 30
inctries
iftries 3 82
jump 80
!
@LABEL 82
exit 0